apiVersion: apps/v1
kind: Deployment
metadata:
  name: logsidecar-injector
  namespace: kubesphere-logging-system
spec:
  replicas: {{ logging.logsidecarReplicas | default(2) }}
  selector:
    matchLabels:
      app: logsidecar-injector
  template:
    metadata:
      labels:
        app: logsidecar-injector
    spec:
      volumes:
        - name: service-certs
          secret:
            secretName: logsidecar-injector-service-certs
        - name: filebeat-config-template
          configMap:
            name: logsidecar-injector-configmap
      containers:
        - image: {{ ks_log_sidecar_injector_repo }}:{{ ks_log_sidecar_injector_tag }}
          imagePullPolicy: IfNotPresent
          name: logsidecar-injector
          resources:
            limits:
              cpu: 100m
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: service-certs
              mountPath: /etc/logsidecar-injector
            - name: filebeat-config-template
              mountPath: /etc/logsidecar-injector/filebeat

---

apiVersion: v1
kind: Service
metadata:
  name: logsidecar-injector
  namespace: kubesphere-logging-system
spec:
  ports:
    - port: 443
      protocol: TCP
      targetPort: 8443
  selector:
    app: logsidecar-injector